/*
 * Copyright (C) 2017-2021
 * All rights reserved, Designed By
 * Copyright authorization contact 18814114118
 */
package com.shop.cereshop.business.service.shop;

import com.shop.cereshop.business.param.shop.ShopQualificationParam;
import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.exception.CoBusinessException;

/**
 * 店铺资质认证流程管理服务接口
 */
public interface CereShopQualificationFlowService {

    /**
     * 开始资质认证流程
     *
     * @param param 认证参数
     * @param user 当前用户
     * @return 认证流程ID
     * @throws CoBusinessException 业务异常
     */
    String startQualificationFlow(ShopQualificationParam param, CerePlatformBusiness user) throws CoBusinessException;

    /**
     * OCR识别营业执照
     *
     * @param imageUrl 营业执照图片URL
     * @param flowId 认证流程ID
     * @return OCR识别结果
     * @throws CoBusinessException 业务异常
     */
    Object recognizeBusinessLicense(String imageUrl, String flowId) throws CoBusinessException;

    /**
     * 提交身份证人脸识别
     *
     * @param idCardNumber 身份证号
     * @param faceImageUrl 人脸照片URL
     * @param flowId 认证流程ID
     * @return 人脸识别结果
     * @throws CoBusinessException 业务异常
     */
    Object submitFaceRecognition(String name , String idCardNumber, String faceImageUrl, String flowId) throws CoBusinessException;

    /**
     * 完成资质认证并创建店铺
     *
     * @param flowId 认证流程ID
     * @param user 当前用户
     * @return 店铺信息
     * @throws CoBusinessException 业务异常
     */
    Object completeQualificationAndCreateShop(String flowId, CerePlatformBusiness user) throws CoBusinessException;

    /**
     * 获取认证流程状态
     *
     * @param flowId 认证流程ID
     * @return 流程状态信息
     * @throws CoBusinessException 业务异常
     */
    Object getQualificationFlowStatus(String flowId) throws CoBusinessException;

    /**
     * 取消认证流程
     *
     * @param flowId 认证流程ID
     * @param user 当前用户
     * @return 取消结果
     * @throws CoBusinessException 业务异常
     */
    String cancelQualificationFlow(String flowId, CerePlatformBusiness user) throws CoBusinessException;
}
